<?php
if ($_REQUEST["odeslat_sila"]) {
    $pecha_sila_utok = $_POST[pecha_sila_utok];
    $obr_sila_utok = $_POST[obr_sila_utok];
    $tank_sila_utok = $_POST[tank_sila_utok];
    $stihy_sila_utok = $_POST[stihy_sila_utok];
    $vrtule_sila_utok = $_POST[vrtule_sila_utok];
    $pecha_sila_obrana = $_POST[pecha_sila_obrana];
    $obr_sila_obrana = $_POST[obr_sila_obrana];
    $tank_sila_obrana = $_POST[tank_sila_obrana];
    $stihy_sila_obrana = $_POST[stihy_sila_obrana];
    $vrtule_sila_obrana = $_POST[vrtule_sila_obrana];
    $kasarny = $_POST[kasarny];

    $dotaz1 = MySQL_Query("UPDATE sila SET pecha_sila_utok=$pecha_sila_utok WHERE kdo LIKE '$kdo'");
    $dotaz2 = MySQL_Query("UPDATE sila SET obr_sila_utok=$obr_sila_utok WHERE kdo LIKE '$kdo'");
    $dotaz3 = MySQL_Query("UPDATE sila SET tank_sila_utok=$tank_sila_utok WHERE kdo LIKE '$kdo'");
    $dotaz4 = MySQL_Query("UPDATE sila SET stihy_sila_utok=$stihy_sila_utok WHERE kdo LIKE '$kdo'");
    $dotaz5 = MySQL_Query("UPDATE sila SET vrtule_sila_utok=$vrtule_sila_utok WHERE kdo LIKE '$kdo'");

    $dotaz1 = MySQL_Query("UPDATE sila SET pecha_sila_obrana=$pecha_sila_obrana WHERE kdo LIKE '$kdo'");
    $dotaz2 = MySQL_Query("UPDATE sila SET obr_sila_obrana=$obr_sila_obrana WHERE kdo LIKE '$kdo'");
    $dotaz3 = MySQL_Query("UPDATE sila SET tank_sila_obrana=$tank_sila_obrana WHERE kdo LIKE '$kdo'");
    $dotaz4 = MySQL_Query("UPDATE sila SET stihy_sila_obrana=$stihy_sila_obrana WHERE kdo LIKE '$kdo'");
    $dotaz5 = MySQL_Query("UPDATE sila SET vrtule_sila_obrana=$vrtule_sila_obrana WHERE kdo LIKE '$kdo'");
} // IF REGUEST ODESLAT_SILA

$vysledek = MySQL_Query("SELECT * FROM sila WHERE kdo LIKE '$kdo'");
while ($zaznam = MySQL_Fetch_Array($vysledek)) {
    $pecha_sila_utok = $zaznam['pecha_sila_utok'];
    $obr_sila_utok = $zaznam['obr_sila_utok'];
    $tank_sila_utok = $zaznam['tank_sila_utok'];
    $stihy_sila_utok = $zaznam['stihy_sila_utok'];
    $vrtule_sila_utok = $zaznam['vrtule_sila_utok'];

    $pecha_sila_obrana = $zaznam['pecha_sila_obrana'];
    $obr_sila_obrana = $zaznam['obr_sila_obrana'];
    $tank_sila_obrana = $zaznam['tank_sila_obrana'];
    $stihy_sila_obrana = $zaznam['stihy_sila_obrana'];
    $vrtule_sila_obrana = $zaznam['vrtule_sila_obrana'];
} // IF WHILE
?>
<h1><font color="red">Tohle budu ještě upravovat. Potřebuju vidět ty levely na bkc, nemůžu si vymyslet jen tak vzorce ;) Takže sílu zatím berte jen jako oeientační</font></h1>
<!--<p class="reflex">1. Pro změnu obrázku, tzn i síly jednotek, klikejte na obrázky a hodnoty se vyplní.<br /><br />
    2. Ostatní kraje kalkulačku mužou vidět, takže neměňte obrázky před war, ale třeba během. ;)<br /><br /></p>-->

<table width="100%" height="259" border="0">
    <form name="form1" method="post" action="?k=<?php echo $kdo . "&kod=" . $kod . "&vyber=" . $vyber; ?>">       
        <tr>
            <td rowspan="2">Pěchota</td>
            <td rowspan="2"><img src="obr/jednotky/j01.jpg" width="79" height="63" /></td>
            <td>Útok: <input name="pecha_sila_utok" type="text" value="<?php echo $pecha_sila_utok; ?>"></td>
<!--            <td><input type="button" name="pecha_sila_utok_plus" value="+ 4%"></td>-->
        </tr>
        <tr>
            <td>Obrana: <input name="pecha_sila_obrana" type="text" value="<?php echo $pecha_sila_obrana; ?>"></td>
<!--            <td><input type="button" name="pecha_sila_obrana_plus" value="+ 6%"></td>-->
        </tr>

        <tr>
            <td rowspan="2">Lehká pozemní technika</td>
            <td rowspan="2"><img src="obr/jednotky/j02.jpg" width="79" height="63" /></td>
            <td>Útok: <input name="obr_sila_utok" type="text" value="<?php echo $obr_sila_utok; ?>"></td>
<!--            <td><input type="button" name="obr_sila_utok" value="+ 4%"></td>-->
        </tr>
        <tr>
            <td>Obrana: <input name="obr_sila_obrana" type="text" value="<?php echo $obr_sila_obrana; ?>"></td>
<!--            <td><input type="button" name="obr_sila_obrana" value="+ 6%"></td>-->
        </tr>

        <tr>
            <td rowspan="2">Těžká pozemní technika</td>
            <td rowspan="2"><img src="obr/jednotky/j03.jpg" width="79" height="63" /></td>
            <td>Útok: <input name="tank_sila_utok" type="text" value="<?php echo $tank_sila_utok; ?>"></td>
<!--            <td><input type="button" name="tank_sila_utok" value="+ 4%"></td>-->
        </tr>
        <tr>
            <td>Obrana: <input name="tank_sila_obrana" type="text" value="<?php echo $tank_sila_obrana; ?>"></td>
<!--            <td><input type="button" name="tank_sila_obrana" value="+ 6%"></td>-->
        </tr>        

        <tr>
            <td rowspan="2">Stíhačka</td>
            <td rowspan="2"><img src="obr/jednotky/j04.jpg" width="79" height="63" /></td>
            <td>Útok: <input name="stihy_sila_utok" type="text" value="<?php echo $stihy_sila_utok; ?>"></td>
<!--            <td><input type="button" name="stihy_sila_utok" value="+ 4%"></td>-->
        </tr>
        <tr>
            <td>Obrana: <input name="stihy_sila_obrana" type="text" value="<?php echo $stihy_sila_obrana; ?>"></td>
<!--            <td><input type="button" name="stihy_sila_obrana" value="+ 6%"></td>-->
        </tr>

        <tr>
            <td rowspan="2">Vrtulník</td>
            <td rowspan="2"><img src="obr/jednotky/j05.jpg" width="79" height="63" /></td>
            <td>Útok: <input name="vrtule_sila_utok" type="text" value="<?php echo $vrtule_sila_utok; ?>"></td>
<!--            <td><input type="button" name="vrtule_sila_utok" value="+ 4%"></td>-->
        </tr>
        <tr>
            <td>Obrana: <input name="vrtule_sila_obrana" type="text" value="<?php echo $vrtule_sila_obrana; ?>"></td>
<!--            <td><input type="button" name="vrtule_sila_obrana" value="+ 6%"></td>-->
        </tr>
        <tr class="lichy">
            <td colspan="4"><input type="submit" name="odeslat_sila" id="odeslat_sila" value="Odeslat"></td>
        </tr>
    </form>
</table>